package com.sh.rbac.domain.enums;

import lombok.Getter;

/**
 * 用户类型枚举
 *
 * @author wb
 * @since 2025-02-10
 */
@Getter
public enum UserTypeEnum {
    ADMIN(0, "超级管理员"),
    NORMAL(1, "普通用户");

    private final Integer code;

    private final String desc;

    UserTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    /**
     * 判断是否是管理员
     *
     * @param code 编码
     * @return boolean
     */
    public static Boolean isAdmin(Integer code) {
        return ADMIN.getCode().equals(code);
    }
}
